package com.neu;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.neu.databinding.ActivityMyBinding;

public class MyActivity extends AppCompatActivity {

    ActivityMyBinding binding;
    private User user;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       binding=ActivityMyBinding.inflate(getLayoutInflater());
       setContentView(binding.getRoot());
       user=new User();
       user.setName("我是用户");
       binding.setUser(user);
    }

    public void btnOne(View view) {
        user.setName("用户修改了数据");
    }

    public void btnTwo(View view) {
        Log.d("TAG", "btnTwo: "+user.getName());
    }
}